import request from '@/utils/request'

export function page(query) {
  return request({
    url: '/api/dict/dictType/page',
    method: 'get',
    params: query
  })
}

export function addDictType(obj) {
  return request({
    url: '/api/dict/dictType',
    method: 'post',
    data: obj
  })
}

export function putDictType(id, obj) {
  return request({
    url: '/api/dict/dictType/' + id,
    method: 'put',
    data: obj
  })
}


export function delDictType(id) {
  return request({
    url: '/api/dict/dictType/' + id,
    method: 'delete'
  })
}

export function dictValuePage(query) {
  return request({
    url: '/api/dict/dictValue/page',
    method: 'get',
    params: query
  })
}

export function addDictValue(obj) {
  return request({
    url: '/api/dict/dictValue',
    method: 'post',
    data: obj
  })
}

export function putDictValue(id, obj) {
  return request({
    url: '/api/dict/dictValue/' + id,
    method: 'put',
    data: obj
  })
}

export function delDictValue(id) {
  return request({
    url: '/api/dict/dictValue/' + id,
    method: 'delete'
  })
}

export function validationCode(code) {
  return request({
    url: '/api/dict/dictValue/validationCode/' + code,
    method: 'GET'
  })
}


export function validationDictCode(code) {
  return request({
    url: '/api/dict/dictType/validationCode/' + code,
    method: 'GET'
  })
}

export function dictSelect(code) {
  return request({
    url: '/api/dict/dictType/dictSelect/' + code,
    method: 'GET'
  })
}

export function dictSelectAll(code) {
  return request({
    url: '/api/admin/dictValue/getDict/' + code,
    method: 'get'
  })
}
